package myschool.myshchool15.homework;

import java.util.Scanner;

/**计算客户比例*/
public class CustomerAge {
    public static void main(String[] args){
        Scanner input = new Scanner(System.in);
        double age ;
        double numberSan = 0;
        double numberDsan = 0;
        for(int i = 1; i <= 10 ;i++){
            System.out.println("请输入第"+i+"位顾客的年龄");
            age = input.nextDouble();
            if(age <= 30){
                numberSan++;
            }else{
                numberDsan++;
            }

        }
        System.out.println("30岁以下的顾客比例为："+(numberSan/10*100)+"%");
        System.out.println("30岁以上的顾客比例为："+(numberDsan/10*100)+"%");

    }
}
